﻿using AliCharacter_recognition.Utils.Ali.AliOss;
using CatUtils.Utils.Currency.IoUtils;
using CatUtils.Utils.Enhance.Encrypt;
using CatUtils.Utils.Helper;
using System;

namespace AliCharacter_recognition.Utils.UserUtils.AliUser
{
    class UserAliOssHelper
    {
        /// <summary>
        /// 保存用户的UserAccessKeyId
        /// </summary>
        public static string UserAccessKeyId = StaticValue.BinPath + "UserAccessKeyId";
        /// <summary>
        /// 保存用户的UserAccessKeySecret
        /// </summary>
        public static string UserAccessKeySecret = StaticValue.BinPath + "UserAccessKeySecret";
        public static bool UpLoadFile(string FilePath)
        {
            
            var OssClient = AliOssTool.GetOssClient(AliOssTool.EndPointBeiJing, ConfigurationEncrypt.GetCofiguration(UserAccessKeyId,true,true),
                ConfigurationEncrypt.GetCofiguration(UserAccessKeySecret,true,true));
            AliOssTool.UploadFile(OssClient, "cat-data",DateTime.Now.ToString("yyyy-MM-dd")+"/"+FileNameHelper.GetFileName(FilePath), FilePath);

            return false;
        }
    }
}
